<ui:composition template="/WEB-INF/templates/main-template.xhtml" 
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" >
	
	<ui:param name="pageName" value="Misc Expense Report" />
	
	<ui:define name="sidebar">
		<ui:include src="/WEB-INF/templates/public-sidebar.xhtml"/>
	</ui:define>
	<ui:define name="content">
		
		<h:outputText value="Miscellaneous Expense Report" styleClass="outputTextTitle"/>	
		<h:form> 
		 <p:growl/>
		 
		 <p:panel header="Miscellaneous Expense Report"> 
		 	<h:panelGrid columns="4" > 
            	    
		    	    <h:outputLabel value="* Year" style="font-weight:bold;"/>
		    	    <h:outputLabel value="* Month" style="font-weight:bold;float:left;"/>
		    	    <h:outputLabel value="Status" style="font-weight:bold;float:left;"/>
		    	    <h:outputLabel value="" />
		    	    
		    	    <p:selectOneMenu value="#{miscExpenseReportBean.selectedYear}" style="width:100px;">
			              <f:selectItems value="#{attendanceBean.yearsMap}" />
		            </p:selectOneMenu>
		    	   
		    	    <p:selectOneMenu value="#{miscExpenseReportBean.selectedMonth}" style="width:100px;">
			              <f:selectItems value="#{attendanceBean.monthsMap}" />
		            </p:selectOneMenu>
		    	    
		    	    <p:selectOneMenu value="#{miscExpenseReportBean.selectedStatus}" style="width:100px;">
			              <f:selectItem itemLabel="--Select One--" itemValue="" />
			              <f:selectItems value="#{miscExpenseReportBean.statusMap}" />
		            </p:selectOneMenu>
		    	    		           
		            <p:commandButton id="Search" value="Search" update="@form"  action="#{miscExpenseReportBean.miscexpenseReportAction}"  />
             </h:panelGrid>
             
             <!-- Search Result DataList -->
             	<p:scrollPanel style="width:900px;" mode="native"> 
			    <p:dataTable paginator="true" rows="20" id="miscExpenses" value="#{miscExpenseReportBean.miscExpensesList}" var="miscExpense" rendered="#{miscExpenseReportBean.renderMiscExpenseList}">  
	  
		            <p:column> 
		 				<f:facet name="header">  
		            		<h:outputText value="S.No" />  
		       		    </f:facet> 
		                <h:outputText value="#{miscExpense.sNo}" />
		            </p:column>  
		            
		            <p:column> 
		            	<f:facet name="header">  
		            		<h:outputText value="Misc Expense Code" />  
		       		    </f:facet> 
		                <h:outputText value="#{miscExpense.miscExpenseCode}" />
		            </p:column>  
		            
		            <p:column> 
		  				<f:facet name="header">  
		            		<h:outputText value="Request Date" />  
		       		    </f:facet> 
		              	<h:outputText value="#{miscExpense.requestDate}"  > 
		              		<f:convertDateTime pattern="dd-MMM-yyyy" timeZone="#{miscExpenseReportBean.timeZone}"/>
		              	</h:outputText> 	               
		            </p:column>  
		  
		           <p:column> 
		            	<f:facet name="header">  
		            		<h:outputText value="Employee Name" />  
		       		    </f:facet> 
		                <h:outputText value="#{miscExpense.employee.firstName} #{miscExpense.employee.lastName}" />  
		            </p:column> 
		            
		            <p:column> 
		            	<f:facet name="header">  
		            		<h:outputText value="Email" />  
		       		    </f:facet> 
		                <h:outputText value="#{miscExpense.employee.email}" />  
		            </p:column> 
		            
		            <p:column> 
		            	<f:facet name="header">  
		            		<h:outputText value="Contact No" />  
		       		    </f:facet> 
		                <h:outputText value="#{miscExpense.employee.telephone}" />  
		            </p:column> 
		            
		           <p:column> 
		                <f:facet name="header">  
		            		<h:outputText value="Module Name" />  
		       		    </f:facet> 
		                <h:outputText value="#{miscExpense.employee.moduleName}" />  
		            </p:column> 
		            
		            <p:column> 
		            	<f:facet name="header">  
		            		<h:outputText value="Expense Pupose" />  
		       		    </f:facet> 
		                <h:outputText value="#{miscExpense.expensePurpose}" />
		            </p:column> 
		            
		            <p:column> 
		            	<f:facet name="header">  
		            		<h:outputText value="Expense Location" />  
		       		    </f:facet> 
		                <h:outputText value="#{miscExpense.expenseLocation}" />
		            </p:column>  
		            
		             <p:column> 
		            	<f:facet name="header">  
		            		<h:outputText value="Expense Status" />  
		       		    </f:facet> 
		                <h:outputText value="#{miscExpense.expenseStatus}" />
		            </p:column>
		            
		             <p:column> 
		            	<f:facet name="header">  
		            		<h:outputText value="Approval Comments " />  
		       		    </f:facet> 
		                <h:outputText value="#{miscExpense.approvalComment}" />
		            </p:column>		            
		            
		             <p:column> 
		            	<f:facet name="header">  
		            		<h:outputText value="Advance Taken(C)" />  
		       		    </f:facet> 
		                <h:outputText value="#{miscExpense.advanceTakenAmount} (#{miscExpense.advanceTakenCurrency})" />
		            </p:column>
		            
		            <p:column> 
		            	<f:facet name="header">  
		            		<h:outputText value="Approved Amount(C)" />  
		       		    </f:facet> 
		                <h:outputText value="#{miscExpense.approvedAmount} (#{miscExpense.approvedCurrency})" />
		            </p:column>
		            
		             <p:column> 
		            	<f:facet name="header">  
		            		<h:outputText value="Balance Pay/Receive(C)" />  
		       		    </f:facet> 
		                <h:outputText value="#{miscExpense.balancepayableAmount} (#{miscExpense.balancePayableCurrency})" />
		            </p:column>      
		             
	             </p:dataTable>
	             </p:scrollPanel>
	             <h:commandLink>  
		            <p:graphicImage value="/resources/styles/images/excel.png" title="Export to Excel"/>  
		            <p:dataExporter type="xls" target="miscExpenses" fileName="Misc_Expense_Details" />  
		        </h:commandLink> 
		 
		 </p:panel>
     </h:form>
	</ui:define>
	
</ui:composition>
